package com.lxg;

import com.lxg.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 陆小根
 * date: 2022/04/23
 * Description:
 */

public class AppForName {

  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

    // 通过bean的别名获取容器中的对象
    BookDao bookDao = (BookDao) context.getBean("dao");
    bookDao.save();
  }

}
